package com.nuanshui.heatedloan.fund.biz.service;

import com.nuanshui.framework.consts.TransactionManagerType;
import com.nuanshui.heatedloan.fund.biz.dal.mapper.OrderNumWithPayNumMapper;
import com.nuanshui.heatedloan.fund.facade.OrderNumWithPayNumService;
import com.nuanshui.heatedloan.fund.model.OrderNumWithPayNum;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service("orderNumWithPayNumService")
@Transactional(value= TransactionManagerType.FUND_TRANSACTION_MANAGER)
public class OrderNumWithPayNumServiceImpl implements OrderNumWithPayNumService {

    @Autowired
    private OrderNumWithPayNumMapper orderNumWithPayNumMapper;

    @Override
    @Transactional(readOnly = false, value= TransactionManagerType.FUND_TRANSACTION_MANAGER)
    public void save(OrderNumWithPayNum orderNumWithPayNum) {
        orderNumWithPayNumMapper.save(orderNumWithPayNum);
    }


    @Override
    public String getOrderNumByPayNum(String orderNum) {
        return orderNumWithPayNumMapper.getOrderNumByPayNum(orderNum);
    }

    public OrderNumWithPayNum loadByOrderNumAndSubType(String orderNum,Integer subType)
    {
        return orderNumWithPayNumMapper.loadByOrderNumAndSubType(orderNum,subType);
    }

    @Override
    public OrderNumWithPayNum loadByPayNum(String payNum) {
        return orderNumWithPayNumMapper.loadByPayNum(payNum);
    }

    @Override
    public OrderNumWithPayNum loadByOrderNum(String orderNum) {
        return orderNumWithPayNumMapper.loadByOrderNum(orderNum);
    }
}
